#pragma once

#ifndef __MATERIALMANAGER_H__
#define __MATERIALMANAGER_H__

#include <list>
#include "TextureManager.h"

struct SMaterial
{
	float ambient[4];
	float diffuse[4];
	float specular[4];
	float emissive[4];
	float shininess;
	CTexture *texture;
};


class CMaterialManager
{
private:
	std::list<SMaterial*> m_Materials;

public:
	CMaterialManager(void);
	~CMaterialManager(void);

//attributes
//    SMaterial* GetMaterial(int index) {return &m_Materials[index - 1];};

	SMaterial* FindMaterial(float &r, float &g, float &b, float &a);
	SMaterial* FindMaterial(CTexture *texture);
	SMaterial* FindMaterial(float *amb, float *dif, float *emi, float *spe);

	SMaterial* AddMaterial(float &r, float &g, float &b, float &a);
	SMaterial* AddMaterial(CTexture *texture);
	SMaterial* AddMaterial(float *amb, float *dif, float *emi, float *spe);

protected:
//	int	 GetMtrlIndex(float &colorR, float &colorG, float &colorB, float &alphaChannel);
};

extern CMaterialManager gMaterialManager;

#endif